<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>{BEESCRM:$title}</title>
    <meta name="description" content="">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui, user-scalable=no">
    <meta http-equiv="cleartype" content="on">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/assets/base/busbooking/css/style.css">
    <link rel="stylesheet" href="/assets/base/busbooking/css/layer.css">
</head>
<body>
<div class="wraper ">
    <div class="header ">
        <a href="javascript:history.go(-1)" class="iconfont icon-llmainpageback back"></a>

        <div class="title text-center font-16">公交专线购票</div>
    </div>
    <div class="content">
        <div class="list gray2">
            请选择检查车次：
        </div>
        <div class="list clearfix padding-0">
            <volist name="class" id="vo">
                <div class="chose-time pull-left text-center gray2">
                    <div class="times " name="times" value="{BEESCRM:$vo.departure_time}">{BEESCRM:$vo.departure_time}
                    </div>
                </div>
            </volist>
        </div>
    </div>
    <a href="#" class="btn text-center font-16 demand">确定</a>
</div>
</body>
<script src="/assets/base/busbooking/js/jquery-2.1.0.min.js"></script>
<script src="/assets/base/busbooking/js/layer.js"></script>
<script src="/assets/base/busbooking/js/public.js"></script>

<script>
    $('.chose-time').on('click', '.times', function () {
        $(this).toggleClass('active');
        $(this).parents('.chose-time').siblings().children().removeClass('active')
    })

    $('.btn').click(function () {
        var class_time = $(".active").text();
        if(!class_time){
            fm.alert('请选择班次');
            return;
        }
        data={};
        data.class_time=class_time;
        data.order_id = {BEESCRM:$order_id};
        $.ajax({
            url:'/Base/BusBookingCheck/CheckTime/apply_id/{BEESCRM:$applyId}',
            data:data,
            type:'POST',
            dataType: "json",
            traditional: true,
            success: function (result) {
                if (result.status == 'S') {
                    //fm.alert('上传成功');
                    window.location.href = "/Base/BusBookingCheck/confirmOrder/apply_id/{BEESCRM:$apply_id}/order_id/{BEESCRM:$order_id}";
                } else {
                    fm.alert('班次重复选择');
                    reload();
                }
            }
        })

    })

    function reload() {
        setTimeout('location.reload()', 2000);
    }
</script>
</html>